/*
 * Created by SharpDevelop.
 * User: David
 * Date: 2006-12-20
 * Time: 03:43
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;

namespace Labb4.Pooman.Cards
{
	/// <summary>
	/// A wrapper around a hand
	/// </summary>
	public class HandProxy : IBasicHand
	{
		#region members
		
		/// <summary>
		/// The hand to proxy for
		/// </summary>
		private Hand		m_Hand;
		
		#endregion
		
		#region constructors
		
		/// <summary>
		/// Constructor, initializes members
		/// </summary>
		public HandProxy()
		{
			m_Hand = null;
		}
		
		#endregion
		
		#region implemented interface methods
		
		/// <summary>
		/// Highlights a card at a given position, if this card is playable in the current context
		/// </summary>
		/// <param name="x">The x coordinate of the card, relative to the screen</param>
		/// <param name="y">The y coordinate of the card, relative to the screen</param>
		public void HighlightCard(ref int x, ref int y)
		{
			m_Hand.HighlightCard(ref x, ref y);
		}
		
		/// <summary>
		/// Selects a card at a given screen coordinate
		/// </summary>
		/// <param name="x">The x coordinate where a card should be selected, relative to the screen</param>
		/// <param name="y">The y coordinate where a card should be selected, relative to the screen</param>
		public void SelectCard(ref int x, ref int y)
		{
			m_Hand.SelectCard(ref x, ref y);
		}
		
		/// <summary>
		/// Gets all the currently selected cards on hand
		/// </summary>
		/// <returns>A CardPile with all the currently selected cards</returns>
		public CardPile GetSelectedCards()
		{
			return m_Hand.GetSelectedCards();
		}
		
		/// <summary>
		/// Checks that a selected card is still selectable in the current context
		/// </summary>
		public void CheckAllSelectedCards()
		{
			m_Hand.CheckAllSelectedCards();
		}
		
		#endregion
		
		#region properties
		
		public Hand ProxyHand
		{
			get
			{
				return m_Hand;
			}
			
			set
			{
				m_Hand = value;
			}
		}
		
		#endregion
	}
}
